# 设置ssh连接时间
echo "ClientAliveInterval 30" >> /etc/ssh/sshd_config
echo "ClientAliveCountMax 3600" >> /etc/ssh/sshd_config
service sshd restart

# 停用防火墙
systemctl disable firewalld
systemctl stop firewalld

# 设置系统时间
export TIME_STYLE='+%Y-%m-%d %H:%M:%S'
source /etc/profile
#rm -rf /etc/localtime
#cp /usr/share/zoneinfo/Asia/Shanghai    /etc/localtime

sysctl -w net.ipv4.tcp_keepalive_time=600
sysctl -w net.ipv4.tcp_keepalive_intvl=30
sysctl -w net.ipv4.tcp_keepalive_probes=10

# 设置源
cd /etc/yum.repos.d/ && mkdir backup && mv *repo backup/
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
sed -i -e "s|mirrors.cloud.aliyuncs.com|mirrors.aliyun.com|g " /etc/yum.repos.d/CentOS-*
sed -i -e "s|releasever|releasever-stream|g" /etc/yum.repos.d/CentOS-*
yum clean all && yum makecache


# 安装docker
yum install yum-utils device-mapper-persistent-data lvm2 -y
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum -y install docker-ce
systemctl start docker
systemctl enable docker

yum remove buildah -y

# 安装git
yum install git -y
git config --global credential.helper store